package com.yanjr.modules.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.yanjr.common.Constants;
import com.yanjr.common.persistence.BaseDaoImpl;
import com.yanjr.modules.sys.dao.DictDao;
import com.yanjr.modules.sys.entity.Dict;

@Repository("dictDao")
public class DictDaoImpl extends BaseDaoImpl<Dict> implements DictDao {

	@Override
	public List<Dict> findAllList() {
		String sql = "select * from sys_dict where del_flag=? order by sort";
		return super.findList(sql, new Object[] {Constants.DEL_FLAG_NORMAL});
	}

	@Override
	public List<String> findTypeList() {
		String sql = "select type from sys_dict where del_flag=? group by type";
		return jdbcTemplate.queryForList(sql, String.class, new Object[] {Constants.DEL_FLAG_NORMAL});
	}

}
